package it.polimi.traveldream.persistence;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the ponte_tratta_pacchetto database table.
 * 
 */
@Embeddable
public class PonteTrattaPacchettoPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(insertable=false, updatable=false)
	private int IDPacchetto;

	@Column(insertable=false, updatable=false)
	private int IDTratta;

	public PonteTrattaPacchettoPK() {
	}
	public int getID() {
		return this.IDPacchetto;
	}
	public void setIDPacchetto(int IDPacchetto) {
		this.IDPacchetto = IDPacchetto;
	}
	public int getIDTratta() {
		return this.IDTratta;
	}
	public void setIDTratta(int IDTratta) {
		this.IDTratta = IDTratta;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PonteTrattaPacchettoPK)) {
			return false;
		}
		PonteTrattaPacchettoPK castOther = (PonteTrattaPacchettoPK)other;
		return 
			(this.IDPacchetto == castOther.IDPacchetto)
			&& (this.IDTratta == castOther.IDTratta);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.IDPacchetto;
		hash = hash * prime + this.IDTratta;
		
		return hash;
	}
}